/* 
 *      DebeGuardarDialog.java
 *
 *      Copyright 2008 Pablo Nicolas Diaz Bilotto <pablonicolas.diaz@gmail.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;


/**
 * The Class DebeGuardarDialog.
 */
public class DebeGuardarDialog extends javax.swing.JDialog {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The panel principal. */
	private JPanel panelPrincipal;

	/** The button aceptar. */
	private JButton buttonAceptar;

	/** The label informacion. */
	private JLabel labelInformacion;

	/**
	 * Instantiates a new debe guardar dialog.
	 * 
	 * @param frame
	 *            the frame
	 */
	public DebeGuardarDialog(JFrame frame) {
		super(frame);
		initGUI();
		this.setLocationRelativeTo(null);
	}

	/**
	 * Button aceptar action performed.
	 * 
	 * @param evt
	 *            the evt
	 */
	private void buttonAceptarActionPerformed(ActionEvent evt) {
		this.dispose();
	}

	/**
	 * Inits the gui.
	 */
	private void initGUI() {
		try {
			{
				getContentPane().setLayout(null);
				this.setTitle("Dialog");
				this.setAlwaysOnTop(true);
				this.setResizable(false);
				{
					panelPrincipal = new JPanel();
					getContentPane().add(panelPrincipal);
					panelPrincipal.setLayout(null);
					panelPrincipal.setBounds(7, 0, 273, 105);
					panelPrincipal.setBorder(BorderFactory
							.createTitledBorder("Informacion"));
					{
						labelInformacion = new JLabel();
						panelPrincipal.add(labelInformacion);
						labelInformacion
								.setText("Debe guardar el archivo antes de Compilar.");
						labelInformacion.setBounds(14, 21, 245, 28);
						labelInformacion
								.setHorizontalAlignment(SwingConstants.CENTER);
						labelInformacion
								.setHorizontalTextPosition(SwingConstants.CENTER);
					}
					{
						buttonAceptar = new JButton();
						panelPrincipal.add(buttonAceptar);
						buttonAceptar.setText("Aceptar");
						buttonAceptar.setBounds(70, 63, 140, 28);
						buttonAceptar.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								buttonAceptarActionPerformed(evt);
							}
						});
					}
				}
			}
			this.setSize(295, 139);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
